﻿using System;

namespace enyo
{
    /// <summary>
    /// A control designed to display data stored in a mojodb database as a list of rows. 
    /// A DbList uses an enyo.VirtualList to manage list rendering.
    /// </summary>
    public class DbList : VirtualList
    {
        public bool Desc { get; set; }


        /// <summary>
        /// Fires when a database query should be made.
        /// DbList maintains a store of database data but does not directly interact with the database.
        /// Use an enyo.DbService or compatible kind to perform the database query.
        /// </summary>
        public EnyoEvent<Control, db8.FindParam> onQuery;


        /// <summary>
        /// Fires when a row is to be rendered. Handler should populate row controls with relevant data as needed.
        /// <para>function(sender, record, idx)</para>
        /// </summary>
        public new EnyoEvent<Control, object, int> onSetupRow;
    }
}
